x86/spec-ctrl: Infrastructure to use VERW to flush pipeline buffers
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 12 Dec 2018 19:22:15 +0000 (19:22 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 14 May 2019 14:37:39 +0000 (15:37 +0100)
commitbd03b27b9ac783e7a8fe473cff16d8a8d9a9ff81
tree7877c012258acc7e57366dd76df7904ec591e614
parentb09886e3c9a40c6339e08e10a30e902e87f7d2ac
x86/spec-ctrl: Infrastructure to use VERW to flush pipeline buffers

Three synthetic features are introduced, as we need individual control of
each, depending on circumstances.  A later change will enable them at
appropriate points.

The verw_sel field doesn't strictly need to live in struct cpu_info.  It lives
there because there is a convenient hole it can fill, and it reduces the
complexity of the SPEC_CTRL_EXIT_TO_{PV,HVM} assembly by avoiding the need for
any temporary stack maintenance.

This is part of XSA-297, CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
(cherry picked from commit 548a932ac786d6bf3584e4b54f2ab993e1117710)
xen/arch/x86/x86_64/asm-offsets.c
xen/include/asm-x86/cpufeatures.h
xen/include/asm-x86/current.h
xen/include/asm-x86/spec_ctrl.h
xen/include/asm-x86/spec_ctrl_asm.h